package com.danawa.mds.market.model;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class HibernateGoodsRepository extends HibernateDaoSupport implements
		GoodsRepository {

	public void save(Goods goods) {
		getHibernateTemplate().save(goods);
	}

	@SuppressWarnings("unchecked")
	public Goods find(Long id) {
		List<Goods> result = (List<Goods>) getHibernateTemplate().find("from Goods where id=?", id);
		if (result != null && result.size() > 0) {
			return result.get(0);
		}
		
		return null;
	}

}
